<?php
namespace Admin\Controller;
use Pub\Tree;
class ColumnsController extends BackendController {

  public function test()
  {
    $a = new Tree();
    dump($a );
    exit;
  }

  public function columnsIndex(){
    //$this->_name = "columns";
    //back(1,"",m("category")->select());

    //$this->getIndex();
    $m = M("columns");
    $list = $m->select();
    $tree = new Tree();
    $tree->titleName = "catname";
    $rslist = $tree->toFormatTree($list);
    //dump($rslist);
    back(1,"", ['rows'=>$rslist]);
  }

  public function columnsSave()
  {
    $this->_name = "columns";
    $this->save();
  }

  public function columnsDel()
  {
    $this->_name = "columns";
    $this->del();
  }
  

}
